import React, { Component } from 'react'

export default class Tab extends Component {
    state = {
        tab: [
            {
                title: "语文",
                context: "语文的内容"
            },
            {
                title: "数学",
                context: "数学的内容"
            },
            {
                title: "英语",
                context: "英语的内容"
            }
        ],
        count: 0
    }
    // 修改count的值
    changeCount = (count) => {
        this.setState({
            count
        })
    }
    render() {
        const { tab, count, one } = this.state
        return (
            <div>
                {/* <ul className="oul">
                    {
                        tab.map((item, index) => {
                            return <li className = { index === count? 'active': '' } onClick = {() => {
                                this.changeCount(index)
                            }} key = { index }>
                                { item.title }
                            </li>
                        })
                    }
                </ul>
                <div className="context">
                    { tab[count].context }
                </div> */}
            </div>
        )
    }
}
